<div class="dux-tools">
  <div class="bread-head">模型管理 <span class="small">模型包括文章、图片、视频等发布功能</span> </div>
  <br>
  <?php if(model('user_group')->model_power('model_manage','visit')){ ?>
  <div class="tools-function clearfix">
    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__URL__"> 管理员列表</a> </div>
    <?php if(model('user_group')->model_power('model_manage','in')){ ?>
    <div class="button-group float-right"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 导入模型 <span class="downward"></span></a>
      <ul class="drop-menu pull-right">
        <li><a href="javascript:;" onclick="model_in('__URL__/in')">导入模型</a></li>
      </ul>
    </div>
   <?php }} ?>
  </div>
</div>
<div class="admin-main"> 
  <!--管理员列表-->
  <div class="panel dux-box">
    <div class="table-responsive">
      <table id="table" class="table table-hover ">
        <tbody>
          <tr>
            <th width="80">编号</th>
            <th width="*">模型名称</th>
            <th width="*">模型标识</th>
            <th width="150">模型操作</th>
          </tr>
          <!--foreach:{$list $vo}-->
          <tr>
            <td>{$vo.mid}</td>
            <td>{$vo.name}模型</td>
            <td>{$vo.model}</td>
            <td><center>
                <?php if(model('user_group')->model_power('model_manage','config')){ ?>
                <a href="javascript:;" onClick="edit('__URL__/setting/id-{$vo.mid}');" class="button bg-blue button-small icon-cog" title="设置"></a>
                <?php } ?>
                <?php if(model('user_group')->model_power('model_manage','out')){ ?>
                &nbsp;&nbsp;<a href="javascript:;" onclick="model_out('{$vo.mid}')" class="button bg-blue button-small icon-pencil" title="导出"></a>
                <?php } ?>
                <?php if(model('user_group')->model_power('model_manage','del')){ ?>
                &nbsp;&nbsp;<a class="button bg-red button-small icon-trash-o js-del" href="javascript:void(0);" onClick="del('{$vo.id}',this)" title="删除"></a>
                <?php } ?>
              </center></td>
          </tr>
          <!--{/foreach}-->
        </tbody>
      </table>
    </div>
  </div>
</div>
<script>
function edit(url) {
	urldialog({
	title:'模型配置',
	url:url
	});
};
function model_in(url) {
	urldialog({
	title:'模型导入',
	url:url
	});
};
function model_out(mid) {
	ajaxpost({
		name:'导出的文件将在网站目录下的"data/module"中，请自行下载！',
		url:"__URL__/out",
		data:{mid:mid},
		tip:1
	});
};
function del(mid,obj) {
	ajaxpost({
		name:'您确定要删除此模型？删除将不可恢复！',
		url:"__URL__/del",
		data:{mid:mid},
		tip:1,
		success:function(){
		$(obj).parent().parent().remove();	
		}}
	);
};
</script>